package com.sixmac.controller;

import com.sixmac.common.base.BaseController;
import com.sixmac.core.plugins.dao.Blade;
import com.sixmac.core.toolbox.ajax.AjaxResult;
import com.sixmac.model.ClientAbout;
import com.sixmac.model.ClientHelp;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by admin on 2018/8/8.
 */
@Controller
@RequestMapping("/api/other")
@ResponseBody
public class OtherController extends BaseController {

    /**
     * @api {post} /api/other/help    帮助
     * @apiName other.help
     * @apiGroup other
     * @apiSuccess {String} data.rows.content 富文本
     */
    @RequestMapping("/help")
    public AjaxResult help() {
        ClientHelp help = Blade.create(ClientHelp.class).findFirstBy("", null);
        return json(getData("content", help.getContent()));
    }

    /**
     * @api {post} /api/other/about    关于我们
     * @apiName other.about
     * @apiGroup other
     * @apiSuccess {String} data.rows.content 富文本
     * @apiError {Integer} 1
     */
    @RequestMapping("/about")
    public AjaxResult about() {
        ClientAbout help = Blade.create(ClientAbout.class).findFirstBy("", null);
        return json(getData("content", help.getContent()));
    }

}
